﻿@model IEnumerable<Model.Article>
@{
    ViewBag.Title = "Articles";
}
 <a href="@Url.Action(MVC.Admin.ArticleAdd())" class="popin add" title="Ajouter un article">
                    Ajouter un article
                </a>     
<h3> Articles existant </h3>
<table>
    <tr>
        <th> Titre </th>
        <th> Contenu  </th>
        <th></th>
        <th></th>
        <th></th>
    </tr>
    @{
    int i = 0;
    }
@foreach (var article in Model)
{
    if (i % 2 == 0)
    {
    <tr class="even">
        <td> @article.Title </td>
        <td> @article.Content </td>
        <td id="keyUpdate"> 
            <a href="@Url.Action(MVC.Admin.ArticleUpdate(article.Id))" title="Modifier" class="modify">
               
            </a>
        </td>
        <td id="redcross"> 
            <a href="@Url.Action(MVC.Admin.ArticleDelete(article.Id))" title="Supprimer" class="delete">
                
            </a>
        </td>
    </tr>
    }else{
         <tr class="odd">
            <td> @article.Title </td>
            <td> @article.Content </td>
            <td id="keyUpdate"> 
                <a href="@Url.Action(MVC.Admin.ArticleUpdate(article.Id))" title="Modifier" class="modify">
               
                </a>
            </td>
            <td id="redcross"> 
                <a href="@Url.Action(MVC.Admin.ArticleDelete(article.Id))" title="Supprimer" class="delete">
                
                </a>
            </td>
        </tr>
    }
     
         i++;

}
</table>
